package com.xxx.controller;

import com.xxx.annotation.RateLimiter;
import com.xxx.enums.LimitType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author eryueer
 * @date 2022/11/8 19:45
 */
@RestController
public class HelloController {

    @GetMapping("/hello")
    @RateLimiter(time = 10,count = 3,limitType = LimitType.DEFAULT) //10秒内允许访问三次
    public String hello(){
        return "hello";
    }
}
